Little changes on Colombian Programming Contest solutions.
[and.git] / 10203 - Snow clearing / 10203.cpp
blobc0e756cdaa5ea1a1098cb963156098878de58c2d
1 #include <stdio.h>
2 #include <iostream>
3 #include <math.h>
5 using namespace std;
7 //Velocity = 20km/h = 20000mt/60min = 2000mt/6min
8 const double v = 2000.0 / 6.0;
10 int main(){
11 double x;
12 int a, b, c, d, n;
13 scanf("%d\n", &n);
15 //cout << "n es: " << n << endl;
17 while (n--){
18 x = 0.0;
19 scanf("%d %d\n", &a, &b);
21 //cout << "a b son: " << a << " " << b << endl;
23 string s;
24 //getline(cin, s);
25 //cout << "s es: " << s << endl;
26 while (getline(cin, s) && sscanf(s.c_str(), "%d %d %d %d", &a, &b, &c, &d) == 4){
27 //cout << "a b c d son: " << a << " " << b << " " << c << " " << d << endl;
28 x += sqrt( (a-c)*(a-c) + (b-d)*(b-d) );
31 int t = floor((2 * x / v) + 0.5);
33 printf("%d:%0.2d\n", t/60, t%60);
35 return 0;